var $ = require("../../utils/Ajax.js");
Page({
  data: {
    // 图片路径配置
    PictureUrl: getApp().PictureUrl,
    KnapsackNav: ["全部", "大转盘","抽奖"],
    Knapsack: [],
    KnapsackIndex: 0
  },

  onLoad: function (options) {
    var that = this;
    wx.setNavigationBarTitle({
      title: "我的背包"
    }) 
    $.Ajax("api/userGift","GET",{},function(res){
      if(res.s){
        that.setData({
          Knapsack: res.d.userGift
        })
      }else{
        wx.showToast({
          title: res.m,
          icon: 'success',
          duration: 2000
        })
      }
    })
  },

  onShow: function () {

  },

  // 点击顶部nav
  KnapsackNav: function(e){
    var Index = e.currentTarget.dataset.index_;
    this.setData({
      KnapsackIndex: Index
    })
  }
})